<?php
//include the functions.php
require "include/functions.php";

//Check valid Session
check_session();
//Check the user to be an administrator
check_admin();
?>
	
<html>
<head>
<title>Home Electronics - Admin page</title>
<link rel="stylesheet" href="include/styles.css" type="text/css">
<script src="include/jquery-1.6.2.min.js"></script>

<script>
//FADE IN/OUT FOR THE IMAGES USING JQUERY AND CSS
$(document).ready(function () {
// find the div.fade elements and hook the hover event
$('div.fade').hover(function() {
// on hovering over, find the element we want to fade *up*
var fade = $('> div', this);
// if the element is currently being animated (to a fadeOut)...
if (fade.is(':animated')) {
// ...take it's current opacity back up to 1
fade.stop().fadeTo(250, 1);
} else {
// fade in quickly
fade.fadeIn(1000,0);
}
}, function () {
// on hovering out, fade the element out
var fade = $('> div', this);
if (fade.is(':animated')) {
fade.stop().fadeTo(1000, 0);
} else {
// fade away slowly
fade.fadeOut(1000);
}
});
});
//END OF JQUERY
</script>
</head>
<body>
<div id="container" align="center">
   <div id="header">
		<div id="topmenu"><ul><?php top_menu(); ?></ul></div> 
		<div id="menu" align="right">
		<form name="form1" method="post" action="search.php">
		<tr>
		<td height="35" width="78"><a>Search Products</a></td>
		<td height="35" width="3">:</td>
		<td height="35" width="294"><input name="mysearch" type="text" id="mysearch">&nbsp;&nbsp;&nbsp;</td>
		</tr>
		</form>
		</div>
		<div id="menubar"> <!-- Menu buttons -->
  		<ul>
		<li><a href="index.php" title="Home"><span>Home</span></a></li>
		<li><a href="#" title="Database Administration"><span>Database Maintenance</span></a></li>
		<li><a href="#" title="Stock Control"><span>Stock Levels</span></a></li>
		<li><a href="#" title="Ordering"><span>Ordering</span></a></li>
    	</ul>
		</div>
	</div> <!-- Header -->


<div id="page">
	
		<br>
		<h1>Welcome To Control Panel, <?=ucfirst($_SESSION['name'])?> </h1> 
			<table class='none' border=0 width="90%" height="40%">
				<tr>			
					<td width="50%">
						<fieldset height="100%">						  
						    <legend>Administration</legend><br>
                                <div class="fade">
                                  <a href="users_admin.php"><img src="images/admin1a.png" /></a>
                                    <div>
                                        <a href="users_admin.php"><img src="images/admin1b.png" /></a>
                                    </div>
                                </div>    
                
                                <div class="fade">
                                  <a href="suppliers_admin.php"><img src="images/admin3a.png" /></a>
                                    <div>
                                        <a href="suppliers_admin.php"><img src="images/admin3b.png" /></a>
                                    </div>
                                </div>    
                
                         <!--<a>Suppliers Orders Administratios</a>	<br> This one will be inside suppliers administration-->
                                 <div class="fade">
                                  <a href="products_admin.php"><img src="images/admin2a.png" /></a>
                                    <div>
                                        <a href="products_admin.php"><img src="images/admin2b.png" /></a>
                                    </div>
                                </div>    
                              
			          </fieldset>
					</td>
					<td>
					  <fieldset height="100%">
                      	<legend>Reports</legend> <br>
                                <div class="fade">
                                  <a href="user_reports.php"><img src="images/admin4a.png" /></a>
                                    <div>
                                        <a href="user_reports.php"><img src="images/admin4b.png" /></a>
                                    </div>
                                </div>    
                
                                <div class="fade">
                                  <a href="suppliers_report.php"><img src="images/admin5a.png" /></a>
                                    <div>
                                        <a href="suppliers_report.php"><img src="images/admin5b.png" /></a>
                                    </div>
                                </div>    
                      		   <div class="fade">
                                  <a href="products_report.php"><img src="images/admin6a.png" /></a>
                                    <div>
                                        <a href="products_report.php"><img src="images/admin6b.png" /></a>
                                    </div>
                                </div>    
                          
						</fieldset>
					</td>			
				</tr>					
			</table><br>
			</div>
	</div> <!--body div -->
<div id="footer" align="center"><? footer(); ?></div>  		
   
</div>

</body>
</html>



